KERNEL_DIR=/home/wei/Desktop/s5pv210/linux-5.7.8
TARGET_NAME=test
NFSROOT=/home/wei/Desktop/nfs/rootfs

obj-m := $(TARGET_NAME).o

ARCH ?= arm
CROSS_COMPILE ?= arm-linux-gnueabi-
MAKE += ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

all:
	$(MAKE) -C $(KERNEL_DIR) M=$(CURDIR) modules
	cp -f $(TARGET_NAME).ko $(NFSROOT)
clean:
	$(MAKE) -C $(KERNEL_DIR) M=$(CURDIR) clean
	rm -rf $(NFSROOT)/$(TARGET_NAME).ko